<?php
session_start ();
error_reporting(0);
include 'include/sql.php';
if (isset ( $_POST ["adminname"] ) && isset ( $_POST ["adminpsw"] )) {
	$u = $_POST ["adminname"];
	$p = $_POST ["adminpsw"];
	$u = mysql_real_escape_string($u);
	$p = mysql_real_escape_string($p);
	$check = checkAdminLogin($u,$p);
	if($check){
		$_SESSION["admin"] = 1;
		echo ("{\"id\":\"admin-login\",\"result\":\"successful\"}");
	}
	else{
		echo ("{\"id\":\"admin-login\",\"result\":\"failed\"}");
	}
}
?>